package org.ciallo.simplemusicplayer.data.model;

import java.util.Objects;

/**
 * @author Jukomu
 * @Description: 用于在列表中显示音乐文件夹信息的临时数据模型
 * @Package: org.ciallo.simplemusicplayer.data.model
 * @Project: SimpleMusicPlayer
 * @name: FolderInfo
 * @Date: 2025/6/3-01:08
 * @Filename: FolderInfo
 */
public class FolderInfo {
    public final String path;       // 文件夹的绝对路径 (作为唯一标识)
    public final String folderName; // 显示的文件夹名称 (通常是路径的最后一部分)
    public int songCount;    // 该文件夹下的歌曲数量
    // public String representativeAlbumArtUri; // 可选：显示文件夹下某首歌的封面

    public FolderInfo(String path, String folderName, int songCount) {
        this.path = path;
        this.folderName = folderName;
        this.songCount = songCount;
    }

    // equals 和 hashCode 主要基于 path，因为它是唯一的
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FolderInfo that = (FolderInfo) o;
        return Objects.equals(path, that.path);
    }

    @Override
    public int hashCode() {
        return Objects.hash(path);
    }
}
